// remjobnet.cpp : definisce il punto di ingresso dell'applicazione DLL.
//

#include "stdafx.h"

#ifdef _MANAGED
#pragma managed(push, off)
#endif

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
					 )
{
	//probabilmente coviene chiamare qui WSAStartup
	WSADATA wsaData;
	DWORD iResult;
//// Initialize Winsock
	switch (ul_reason_for_call){
		case DLL_PROCESS_ATTACH:
			iResult = WSAStartup(MAKEWORD(2,2), &wsaData);
			break;
		case DLL_PROCESS_DETACH:
			WSACleanup();
			break;
		case DLL_THREAD_ATTACH:
		case DLL_THREAD_DETACH:
		default:
			break;
	}
//iResult = WSAStartup(MAKEWORD(2,2), &wsaData);
//if (iResult != 0) {
//    printf("WSAStartup failed: %d\n", iResult);
//    return 1;
//}
	//e anche
	//WSACleanUp();
    return TRUE;
}

#ifdef _MANAGED
#pragma managed(pop)
#endif

